<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="../../common/jsp/taglibs.jsp"/>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>角色授权</title>
    <jsp:include page="../../common/jsp/head.jsp"/>
    <link href="${ctx}css/playRole.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<input type="hidden" name="roleId" id="roleId" value="${param.id}" />
<div class="input" style="width:99%; margin:0 auto; padding:0px; overflow:auto">
    <table class="layui-table access" style="width:100%;" id="menuTable">
        <tr>
            <!-- 一级菜单子模块 -->
            <c:forEach items="${requestScope.firstMenuList}" var="firstList">
                <c:if test="${firstList.parentId==0}">
                    <td valign="top" class="listbox">
                        <ul class="accessList">
                            <li>
                                <h2>
                                    <label>
                                        <input type="checkbox" class="inptchkbx" name="firstChk" value='<c:out value="${firstList.id}"/>'
                                                <c:if test="${firstList.isSelected}"> checked="checked" </c:if> />
                                        <c:out value="${firstList.menuName}" />
                                    </label>
                                </h2>
                                <!-- 二级菜单子模块 -->
                                <ul>
                                    <c:forEach items="${requestScope.secondMenuList}" var="secondList">
                                        <c:if test="${secondList.parentId==firstList.id}">
                                            <li>
                                                <label>
                                                    <input type="checkbox" class="inptchkbx" name="secondChk" value='<c:out value="${secondList.id}"/>'
                                                            <c:if test="${secondList.isSelected}"> checked="checked" </c:if> />
                                                    <c:out value="${secondList.menuName}" />
                                                </label>
                                                <!-- 三级菜单子模块 -->
                                                <ul>
                                                    <c:forEach items="${requestScope.thirdMenuList}" var="thirdList">
                                                        <c:if test="${thirdList.parentId==secondList.id}">
                                                            <li>
                                                                <label>
                                                                    <input type="checkbox" class="inptchkbx" name="thirdChk" value='<c:out value="${thirdList.id}"/>'
                                                                            <c:if test="${thirdList.isSelected}"> checked="checked" </c:if> />
                                                                    <c:out value="${thirdList.menuName}" />
                                                                </label>
                                                            </li>
                                                        </c:if>
                                                    </c:forEach>
                                                </ul>
                                            </li>
                                        </c:if>
                                    </c:forEach>
                                </ul>
                            </li>
                        </ul>
                    </td>
                </c:if>
            </c:forEach>
        </tr>
    </table>
    <div class="layui-form-item">
        <div class="layui-input-inline" style="float:right;margin-top:25px;">
            <a style="float: right;" class="layui-btn layui-btn-primary close">取消</a>
            <a id="submit" style="float: right;margin-right: 15px;" class="layui-btn" lay-submit lay-filter="submit">授权</a>
        </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript" src="${ctx}js/role/roleMenuConfig.js?version=${version}"></script>